package day05.text04.entry;

import day05.text04.controller.Controller;

import java.io.IOException;
import java.util.Scanner;

public class Entry {

    public static void main(String[] args) throws IOException {

        Controller controller = new Controller();
        while (true) {
            System.out.println("欢迎进入商品管理系统");
            System.out.println("请输入1：查看所有信息");
            System.out.println("请输入2：添加商品");
            System.out.println("请输入3：修改商品");
            System.out.println("请输入4：删除商品");
            System.out.println("请输入0:退出");
            Scanner sc = new Scanner(System.in);
            String next = sc.next();
            switch (next){
                case "1":
                    controller.getGoodsList();
                    break;
                case "2":
                    controller.addGoods();
                 break;
                case "3":
                    controller.editGoods();
                    break;
                case "4":
                    controller.deleteGoods();
                    break;
                case "0":
                    System.exit(0);
                default:
                    break;

            }
        }

    }
}
